import os
from openpyxl import load_workbook 
import shutil

xls_name = "1227_S.xlsx"
q_lost = "Transaction_20241228030000"
q_lost00 = "q_lost01"

def excel_files(dir):
    wb = load_workbook(xls_name)
    sheets = wb.worksheets
    print(sheets)

    sheet1 = sheets[0]
    print(sheet1[1])

    rows = sheet1.rows
    for row in rows:
        row_val = [col.value for col in row]
        print(row_val[0])
        copy_files(dir,row_val[0])

def copy_files(dir,file_name):
    for path in os.listdir(dir):
        if file_name in path :
            print(path)
            shutil.copy(dir + "/" + path, q_lost00 + "/" + path)


excel_files(q_lost)

        
